December 21, 2021 “The Long-Run Consequences of The Opium Concessions for Outgroup Animosity on Java” Nicholas Kuipers World Politics  All correspondence should be directed to Nick Kuipers (nick.kuipers@gmail.com OR nkuipers@berkeley.edu).  ——————————————————————————————————————— ——————————————— This read me file is contained within the (zipped) directory, which contains all the materials necessary to replicate the analyses contained in the article, “The Long-Run Consequences of The Opium Concessions for Outgroup Animosity on Java” Specifically, in the main folder (“replication_file_wp”) you should see two files and three folders:   1. _1_main.R (file) 2. _2_code (folder) 3. _3_data (folder) 4. _4_outputs (folder)  5. _5_readme.rtf (file)  If you are missing any of these files or folders please contact me (Nick). We describe how to navigate these files and folders in turn.  ——————————————————————————————————————— ——————————————— 1. _1_main.R (file)   This is the main file from which all scripts are called. In this file you will need to do two things on your personal machine. First, you will need to set your working directory. If you downloaded the replication file on a Mac, it probably landed in your downloads file (“setwd(“~/Downloads/replication_file_kuipers/“). Second, you will need to install the packages used in our scripts. These are commonly used in political science research, so you probably already have these on your machine. Both of these instructions are also listed in the _1_main.R file.   Once you’ve done these two steps you should be able to replicate the analyses. To replicate the analyses, highlight all of the code and press “Run.” All outputs should be deposited in the “_4_outputs” folder.   2. _2_code (folder)   This folder should contain three subdirectories--one for data cleaning, one for creating the figures, and one for creating the tables. There is also a script titled "functions.R" which contains custom functions used in the analyses. As discussed above, these scripts are “sourced” from the _main.R file, so you shouldn’t need to directly run these files. Each script refers to a single output (i.e. a single table or a single figure found in the paper). They are labelled intuitively, so you should be able to easily located what you're looking for. If you do not find what you are looking for, please contact me. More importantly -- if you discover what you believe to be any errors in the code, please contact me.  3. _3_data (folder)   Upon downloading, this folder should several directories, which contains all the raw data used in the data cleaning scripts to generate the data used in the main analyses. As the data cleaning script takes a good deal of time to run, I also include the cleaned datasets in the "_cleaned_data" subdirectory, which, in the replication file, I load in directly out of time concerns.   4. _4_outputs (folder)   This is an empty folder. After running the scripts, all of the figures included in the paper should appear in here.   5. _5_readme.rtf (file)  
